#include <iostream>

bool isLeapYear(int year) {
    return (year % 4 == 0) && (year % 100 != 0 || year % 400 == 0);
}

int main() {
    int year, month, day;
    std::cout << "请输入年份: ";
    std::cin >> year;
    std::cout << "请输入月份: ";
    std::cin >> month;
    std::cout << "请输入日期: ";
    std::cin >> day;

    int daysInMonth[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
    
    if (isLeapYear(year)) {
        daysInMonth[1] = 29;
    }

    int dayOfYear = 0;
    for (int i = 0; i < month - 1; i++) {
        dayOfYear += daysInMonth[i];
    }
    dayOfYear += day;

    std::cout << "这一天是一年中的第 " << dayOfYear << " 天。" << std::endl;

    return 0;
}